package com.shaokel.eduservice.controller;

import com.shaokel.commonutils.ReturnResult;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 少丶客
 * @ClassName EduLoginController
 * @Description 登录功能级登录信息
 * @Date 2020/5/28 21:18
 * @Vesion 1.0
 */
@RestController
@CrossOrigin   //解决跨域问题
@RequestMapping("/eduservice/user")
public class EduLoginController {

    //登录
    @PostMapping("/login")
    public ReturnResult login(){

        return ReturnResult.ok().data("token","admin");
    }

    //用户信息
    @GetMapping("/info")
    public ReturnResult info(){

        return ReturnResult.ok().data("roles","[admin]").data("name","admin").data("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
    }

}